Skip to content

Set the vterm buffer's major mode before displaying the buffer. #758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tmurph
Copy link

@tmurph tmurph commented Feb 11, 2025

This aligns with the behavior of other terminal emulator modes (e.g. term and ansi-term) and comint-derived modes (e.g. ielm, SQLi, and inferior Python).

@tmurph
Copy link
Author

tmurph commented Feb 11, 2025

Hi! I have some rules in my display-buffer-alist that inspect buffer properties such as major-mode. When my rules weren't correctly catching the vterm buffer on initial creation, but were catching it on subsequent displays, I looked into the reason why.

I doubt other people have a similar issue, and it's easy enough for me to work around it. But here's hoping that this change is small enough that "consistency with other Emacs libraries" is sufficient reason to accept it.

@Sbozzolo
Copy link
Collaborator

This makes sense to me. Would you be able to point me to the equivalent code for some of the other modes you mentioned?

@Thaodan
Copy link

Thaodan commented May 1, 2025

Hi! I have some rules in my display-buffer-alist that inspect buffer properties such as major-mode. When my rules weren't correctly catching the vterm buffer on initial creation, but were catching it on subsequent displays, I looked into the reason why.

I doubt other people have a similar issue, and it's easy enough for me to work around it. But here's hoping that this change is small enough that "consistency with other Emacs libraries" is sufficient reason to accept it.

I would help to add this explanation to the commit for anyone reviewing the commit history.

This ensures that display-buffer actions that condition on a buffer's
major mode (see the documentation of `display-buffer-alist` and
`buffer-match-p`) properly catch the buffer when it is displayed for the
first time.

This aligns with the behavior of other terminal emulator
modes (e.g. term and ansi-term) and comint-derived modes (e.g. ielm,
SQLi, and inferior Python).
@tmurph tmurph force-pushed the TINYCHANGE-majormode branch from 6cf7aac to d4a0312 Compare May 17, 2025 17:40
@tmurph
Copy link
Author

tmurph commented May 17, 2025

@Thaodan done.

@Thaodan
Copy link

Thaodan commented May 18, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants